home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 11 - 1995 / 11.10 Oct 95 / Executing OSA Scripts from Apps / TRunOSA.h < prev   
Encoding:
C/C++ Source or Header  |  1995-05-08  |  1.0 KB  |  52 lines  |  [TEXT/MMCC]

  1. /*
  2. *    TRunOSA.h
  3. *
  4. *    Declaration for 'TRunOSA', a C++
  5. *    class to manipulate AppleScripts
  6. *
  7. *    azn@nemeng.mpx.com.au
  8. *
  9. *    © Andrew Nemeth  Warrimoo  Australia  1995
  10. */
  11.  
  12. #pragma once
  13.  
  14. class  TRunOSA
  15. {
  16.     private:
  17.         static         ComponentInstance    scriptComponent;
  18.     
  19.     public:
  20.         TRunOSA ();
  21.         ~TRunOSA ();
  22.     
  23.         OSAError        initOSA ( void );
  24.         OSAError        initOSA ( const FSSpec & );
  25.     
  26.         OSAError        runScript ( void );
  27.         OSAError        runScript ( const AEEventClass, const AEEventID );
  28.         OSAError        runScript ( const AEEventClass, const AEEventID, Str255 );
  29.     
  30.         OSAError        getResultDesc ( AEDesc *, long * );
  31.     
  32.     private:
  33.         AEDesc            f_aedescScript;
  34.         OSAID            f_osaidOriginal,
  35.                         f_osaidResult;
  36.     
  37.         OSAError        myInitOSA ( Handle );
  38.         OSAError        myRunScript ( const AEEventClass, const AEEventID, AEDesc * );
  39.     
  40.     private:
  41.         TRunOSA ( const TRunOSA & );
  42.         TRunOSA          &  operator= ( const TRunOSA & );
  43. };
  44.     
  45.  
  46. inline OSAError    TRunOSA::runScript ( const AEEventClass aeclassSuite, 
  47.                                     const AEEventID aesuiteKind )
  48. {
  49.     return( myRunScript ( aeclassSuite, aesuiteKind, NULL ) );
  50. }
  51.  
  52.